package com.pe.pgn.clubpgn.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.pe.pgn.clubpgn.dao.ArticuloDao;
import com.pe.pgn.clubpgn.domain.ClpdArticulo;
import com.pe.pgn.clubpgn.domain.beans.BNArticulo;
import com.pe.pgn.clubpgn.service.ArticuloService;

@Service("articuloService")
public class ArticuloServiceImpl extends GenericManagerImpl<ClpdArticulo, Long> implements
		ArticuloService {

	@Autowired
	private ArticuloDao articuloDao;
	
	public List<Map<String, Object>> buscarArticulos(String deArticulo,
			String coCodigoArticulo, Long coCategoria, String stArticulo,
			String stManejaStock) {
		
		return articuloDao.buscarArticulos(deArticulo, coCodigoArticulo, coCategoria, stArticulo, stManejaStock);
	}

	public void eliminarArticulo(Long id) {
		
		articuloDao.eliminarArticulo(id);
	}

	public boolean esArticuloConDependencias(Long id) {
		
		return articuloDao.esArticuloConDependencias(id);
	}

	public void guardarArticulo(ClpdArticulo articulo) {
		
		articuloDao.guardarArticulo(articulo);
	}
	
	public ClpdArticulo obtenerArticulo(Long id) {
		
		return articuloDao.obtenerArticulo(id);
	}
	
	public List<ClpdArticulo> obtenerArticulos() {
		
		return articuloDao.obtenerArticulos();
	}

	@Override
	public BNArticulo obtenerArticuloPorID(Long id) {
		
		return articuloDao.obtenerArticuloPorID(id);
	}

}
